/**
 * 
 */
package com.eugene.enums;

import com.eugene.element.FnCalendar;
import com.eugene.element.Holiday;

/**
 * @author takion77@gmail.com
 *
 */
public enum EBizDayRule {
	RGL_FLW {
				public FnCalendar getBizDay(Holiday hol, FnCalendar cal, int n){
					return hol.getNextBizDay(cal, n);
				}
			},
	MDF_FLW	{
				public FnCalendar getBizDay(Holiday hol, FnCalendar cal, int n){
					FnCalendar date = hol.getNextBizDay(cal, n);
					if (date.getRealMonth() == cal.getRealMonth()){
						return date;
					}
					return hol.getPreviousBizDay(cal,1);
				}
			},
				
			
	RGL_PRC {
				public FnCalendar getBizDay(Holiday hol, FnCalendar cal, int n){
					return hol.getPreviousBizDay(cal, n);
				}
			},
	MDF_PRC	{
				public FnCalendar getBizDay(Holiday hol, FnCalendar cal, int n){
					FnCalendar date = hol.getPreviousBizDay(cal, n);
					if (date.getRealMonth() == cal.getRealMonth()){
						return date;
					}
					return hol.getNextBizDay(cal,1);
				}
			},
	NONE ;
	
	public FnCalendar getBizDay(Holiday hol, FnCalendar cal, int n){
		return cal;
	}

}
